Fix another leak
authorMatthias Clasen <matthiasc@src.gnome.org>
Thu, 4 Jan 2007 05:09:08 +0000 (05:09 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 4 Jan 2007 05:09:08 +0000 (05:09 +0000)
svn path=/trunk/; revision=17050

ChangeLog
modules/printbackends/cups/gtkprintbackendcups.c

index 3c084b7fa19dca1dedf6a2504ade3922718e4b89..0f72a02c339f5e528a544c6026c3bdb8a87b143c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-01-03  Matthias Clasen  <mclasen@redhat.com>
 
+       * modules/printbackends/cups/gtkprintbackendcups.c 
+       (available_choices): Don't leak conflicts.
+
        * gtk/gtkprintoperation.c (gtk_print_operation_finalize):
        Don't leak the status string.
 
index bd389eba2a65ff9dd01e228e4278bea5a71b8537..6a31463acaa1a90c2e10c71a3d3d86a1434fc424 100644 (file)
@@ -1786,12 +1786,13 @@ available_choices (ppd_file_t     *ppd,
        all_default = FALSE;
     }
 
-  if (all_default && !keep_if_only_one_option)
-    return 0;
-  
-  if (num_conflicts == option->num_choices)
-    return 0;
+  if ((all_default && !keep_if_only_one_option) ||
+      (num_conflicts == option->num_choices))
+    {
+      g_free (conflicts);
 
+      return 0;
+    }
 
   /* Some ppds don't have a "use printer default" option for
    * InputSlot. This means you always have to select a particular slot,
@@ -1830,7 +1831,6 @@ available_choices (ppd_file_t     *ppd,
   
   if (available)
     {
-      
       *available = g_new (ppd_choice_t *, option->num_choices - num_conflicts + add_auto);
 
       i = 0;
@@ -1843,6 +1843,8 @@ available_choices (ppd_file_t     *ppd,
       if (add_auto) 
        (*available)[i++] = NULL;
     }
+
+  g_free (conflicts);
   
   return option->num_choices - num_conflicts + add_auto;
 }